using System;
using System.ComponentModel.DataAnnotations;

namespace ERP.Core.Models.Production
{
    public class Supplier
    {
        public int Id { get; set; }

        [Required(ErrorMessage = "供应商名称不能为空")]
        [StringLength(100, ErrorMessage = "供应商名称不能超过100个字符")]
        [Display(Name = "供应商名称")]
        public string Name { get; set; }

        [Required(ErrorMessage = "联系人不能为空")]
        [StringLength(50, ErrorMessage = "联系人不能超过50个字符")]
        [Display(Name = "联系人")]
        public string ContactPerson { get; set; }

        [Required(ErrorMessage = "联系电话不能为空")]
        [StringLength(20, ErrorMessage = "联系电话不能超过20个字符")]
        [Display(Name = "联系电话")]
        public string Phone { get; set; }

        [EmailAddress(ErrorMessage = "邮箱格式不正确")]
        [StringLength(100, ErrorMessage = "邮箱不能超过100个字符")]
        [Display(Name = "邮箱")]
        public string Email { get; set; }

        [StringLength(200, ErrorMessage = "地址不能超过200个字符")]
        [Display(Name = "地址")]
        public string Address { get; set; }

        [Display(Name = "创建时间")]
        public DateTime CreatedAt { get; set; } = DateTime.Now;

        [Display(Name = "更新时间")]
        public DateTime? UpdatedAt { get; set; }
        
        [StringLength(500, ErrorMessage = "备注不能超过500个字符")]
        [Display(Name = "备注")]
        public string Remarks { get; set; }
        
        [Display(Name = "是否活跃")]
        public bool IsActive { get; set; } = true;
        
        [Display(Name = "供应商类别")]
        public int? CategoryId { get; set; }
        
        [StringLength(50, ErrorMessage = "税号不能超过50个字符")]
        [Display(Name = "税号")]
        public string TaxNumber { get; set; }
        
        [StringLength(100, ErrorMessage = "银行账户不能超过100个字符")]
        [Display(Name = "银行账户")]
        public string BankAccount { get; set; }
    }
} 